package com.example.mvpdemo.login;

import com.example.mvpdemo.base.BaseModel;

public class LoginModel extends BaseModel<LoginPresenter, Ilogin.M> {
    public LoginModel(LoginPresenter mPresenter) {
        super(mPresenter);
    }

    @Override
    public Ilogin.M getContract() {
        return new Ilogin.M() {
            @Override
            public void requestLogin(String name, String pwd) throws Exception {
                //请求服务器接口
        if ("abc".equals(name) && "123".equals(pwd)) {
            mPresenter.getContract().requestLoginResult(true);
        } else {
            mPresenter.getContract().requestLoginResult(false);
        }
            }
        };
    }

//    @Override
//    public void requestLogin(String name, String pwd) throws Exception {
//        //请求服务器接口
//        if ("abc".equals(name) && "123".equals(pwd)) {
//            mPresenter.requestLoginResult(true);
//        } else {
//            mPresenter.requestLoginResult(false);
//        }
//    }
}
